#pragma once

#include <mutex>
#include <memory>
#include <condition_variable>

class EZRPC_Signal;
typedef std::shared_ptr<EZRPC_Signal> EZRPC_SignalPtr;

class EZRPC_Signal
{
public:
	EZRPC_Signal() : nty_(false){}

	void signal();

	bool wait_for(int intr = 5000);

	void wait();
private:
	std::mutex m_mutex;
	std::condition_variable m_cond;
	bool	 nty_;
};

